package com.open4cn.simulator.core.device;

import cn.hutool.json.JSONUtil;
import lombok.Getter;
import lombok.Setter;

import java.io.Serializable;

/**
 * @author yinxiaopeng
 * @version 1.0.0
 * @company 致景科技
 * @department 飞梭BU/研发
 * @description
 * @Email yinxiaopeng@zj.tech
 * @date 2022-05-19 17:54
 */
@Setter
@Getter
public class DeviceStatusDO implements Serializable {

    // 设备id
    private String deviceId;

    // 设备品牌
    private String brand;

    // 设备型号
    private String model;

    // DeviceStatus的json字符串形式
    private String statusJson;


    public DeviceStatusDO() {
    }

    public DeviceStatusDO(DeviceStatus deviceStatus) {
        this.deviceId = deviceStatus.getDeviceId();
        this.brand = deviceStatus.getBrand();
        this.model = deviceStatus.getModel();
        this.statusJson = JSONUtil.toJsonStr(deviceStatus);
    }

    @Override
    public String toString() {
        return "DeviceStatusDO{" +
                "deviceId='" + deviceId + '\'' +
                ", brand='" + brand + '\'' +
                ", model='" + model + '\'' +
                ", statusJson='" + statusJson + '\'' +
                '}';
    }
}
